home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17630 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.cern.ch!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Re: sizeof() question >>> :)
  5. Date: 16 Apr 96 18:22:19 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.829678939@news.cern.ch>
  8. References: <1996Apr12.061927@topaz> <31714828.1574068@news.linex.com> <4l0dcr$14t0@darwin.nbnet.nb.ca>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=US-ASCII
  12. Content-Transfer-Encoding: 7bit
  13. X-Newsreader: NN version 6.5.0 #7 (NOV)
  14.  
  15. In <4l0dcr$14t0@darwin.nbnet.nb.ca> rwb2@mtt.ca (Rick Bruce) writes:
  16.  
  17. In <31714828.1574068@news.linex.com>, mfried@linex.com (Marty Fried) writes:
  18. >Once upon a time (OK, it was 12 Apr 96 06:19:27 +1000),
  19. >naderr@topaz.cqu.edu.au wrote:
  20. >
  21. >>How can I get, with a pointer,  the sizeof  of an  array that is
  22. >>pointed by the pointer ?  (No it's not a tounge twister :)
  23. >>
  24. >>  while (!done) {
  25. >>    ch = getchar();
  26. >>    if (cp - *ct < sizeof(XXXXXXX)-1) {
  27. >>      *cp++ = ch;
  28. >>    } else {
  29. >>      beep();
  30. >>    }  
  31. >>  }
  32. >
  33. > If you allocate the space for the array you can call one of the memory
  34. > routines which return the size of the allocation.
  35. > Dave Gaudet via Rick Bruce
  36.  
  37. There is no such "routine" in the C language.
  38.  
  39. Dan
  40. --
  41. Dan Pop
  42. CERN, CN Division
  43. Email: danpop@mail.cern.ch 
  44. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  45.